package it.uniroma2.art.coda.main;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import it.uniroma2.art.coda.core.CODACore;
import it.uniroma2.art.coda.exception.PRParserException;
import it.uniroma2.art.coda.projectionrule.ProjectionRulesModel;
import it.uniroma2.art.coda.projectionrule.antlr.ANTLRParserPR;

public class PrintPRModel {

	
	private static Logger logger = LoggerFactory.getLogger(PrintPRModel.class);
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		logger.info("Test started");
		CODACore codaCore = new CODACore();
		
		String prFilePath = "E:/CODATest/provaPR.pr";
		
		
		
		//Set the model for the projectionRule, this is the only place where the projection rule structure is set
		//at the moment the XML format is used
		ProjectionRulesModel prModel = new ProjectionRulesModel();
		ANTLRParserPR parser = new ANTLRParserPR("ANTLR", "parser for a grammar written using ANTLR");
		parser.initialize(prModel, prFilePath, codaCore);
		try {
			parser.parsePR();
		} catch (PRParserException e) {
			e.printStackTrace();
		}
		
		prModel.printModel();
		logger.info("Test started");
		//ParserPR xmlParserPR = new XMLParserPR(); // at the moment the PR File is only written in XML
		//xmlParserPR.initialize(prModel, XMLPRPath);
		//xmlParserPR.startParsingPR();
		
		//printPRModel.printProjRuleModel(prModel);

	}
}
